<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>DjangoRESTframework简介 | 课程介绍</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../C02-DRFProject/index.html" />
    
    
    <link rel="prev" href="../C01-IntroduceToDRF/CoreTaskToDevelopRESTAPI.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="1.6"
        data-chapter-title="DjangoRESTframework简介"
        data-filepath="C01-IntroduceToDRF/AboutDRF.md"
        data-basepath=".."
        data-revision="Thu May 10 2018 07:57:11 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        课程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="C01-IntroduceToDRF/index.html">
            
                
                    <a href="../C01-IntroduceToDRF/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        引入DjangoRESTframework
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="C01-IntroduceToDRF/SeparatedFrontendAndBackend.html">
            
                
                    <a href="../C01-IntroduceToDRF/SeparatedFrontendAndBackend.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        Web应用模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="C01-IntroduceToDRF/IntroduceToREST.html">
            
                
                    <a href="../C01-IntroduceToDRF/IntroduceToREST.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        认识RESTful
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="C01-IntroduceToDRF/HowToDesignREST.html">
            
                
                    <a href="../C01-IntroduceToDRF/HowToDesignREST.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        RESTful设计方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="C01-IntroduceToDRF/DevelopRESTAPIWithDjango.html">
            
                
                    <a href="../C01-IntroduceToDRF/DevelopRESTAPIWithDjango.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        使用Django开发REST接口
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="C01-IntroduceToDRF/CoreTaskToDevelopRESTAPI.html">
            
                
                    <a href="../C01-IntroduceToDRF/CoreTaskToDevelopRESTAPI.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        明确REST接口开发的核心任务
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="1.6" data-path="C01-IntroduceToDRF/AboutDRF.html">
            
                
                    <a href="../C01-IntroduceToDRF/AboutDRF.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        DjangoRESTframework简介
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="C02-DRFProject/index.html">
            
                
                    <a href="../C02-DRFProject/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        DRF工程搭建
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="C02-DRFProject/InstallAndConfig.html">
            
                
                    <a href="../C02-DRFProject/InstallAndConfig.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        环境安装与配置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="C02-DRFProject/TheFirstDRFProgram.html">
            
                
                    <a href="../C02-DRFProject/TheFirstDRFProgram.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        见识DRF的魅力
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="C03-Serializer/index.html">
            
                
                    <a href="../C03-Serializer/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        Serializer序列化器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="C03-Serializer/Declaring.html">
            
                
                    <a href="../C03-Serializer/Declaring.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        定义Serializer
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="C03-Serializer/Serializing.html">
            
                
                    <a href="../C03-Serializer/Serializing.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        序列化使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="C03-Serializer/Deserializing.html">
            
                
                    <a href="../C03-Serializer/Deserializing.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        反序列化使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="C03-Serializer/ModelSerializer.html">
            
                
                    <a href="../C03-Serializer/ModelSerializer.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        模型类序列化器ModelSerializer
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="C04-View/index.html">
            
                
                    <a href="../C04-View/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        视图
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="C04-View/RequestAndResponse.html">
            
                
                    <a href="../C04-View/RequestAndResponse.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        Request与Response
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="C04-View/View.html">
            
                
                    <a href="../C04-View/View.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        视图概览
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="C04-View/ViewIntroduction.html">
            
                
                    <a href="../C04-View/ViewIntroduction.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        视图说明
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="C04-View/ViewSet.html">
            
                
                    <a href="../C04-View/ViewSet.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        视图集ViewSet
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="C04-View/Routers.html">
            
                
                    <a href="../C04-View/Routers.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        路由Router
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="C05-Components/index.html">
            
                
                    <a href="../C05-Components/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        其他功能
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="C05-Components/Authentication.html">
            
                
                    <a href="../C05-Components/Authentication.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        认证
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="C05-Components/Permissions.html">
            
                
                    <a href="../C05-Components/Permissions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        权限
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="C05-Components/Throttling.html">
            
                
                    <a href="../C05-Components/Throttling.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        限流
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="C05-Components/Filtering.html">
            
                
                    <a href="../C05-Components/Filtering.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        过滤
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="C05-Components/Pagination.html">
            
                
                    <a href="../C05-Components/Pagination.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        分页
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="C05-Components/Versioning.html">
            
                
                    <a href="../C05-Components/Versioning.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        版本
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="C05-Components/Exceptions.html">
            
                
                    <a href="../C05-Components/Exceptions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        异常处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="C05-Components/Documents.html">
            
                
                    <a href="../C05-Components/Documents.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.</b>
                        
                        自动生成接口文档
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >课程介绍</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="django-rest-framework-&#x7B80;&#x4ECB;">Django REST framework &#x7B80;&#x4ECB;</h1>
<ol>
<li>&#x5728;&#x5E8F;&#x5217;&#x5316;&#x4E0E;&#x53CD;&#x5E8F;&#x5217;&#x5316;&#x65F6;&#xFF0C;&#x867D;&#x7136;&#x64CD;&#x4F5C;&#x7684;&#x6570;&#x636E;&#x4E0D;&#x5C3D;&#x76F8;&#x540C;&#xFF0C;&#x4F46;&#x662F;&#x6267;&#x884C;&#x7684;&#x8FC7;&#x7A0B;&#x5374;&#x662F;&#x76F8;&#x4F3C;&#x7684;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#x8FD9;&#x90E8;&#x5206;&#x4EE3;&#x7801;&#x662F;&#x53EF;&#x4EE5;&#x590D;&#x7528;&#x7B80;&#x5316;&#x7F16;&#x5199;&#x7684;&#x3002;</li>
<li>&#x5728;&#x5F00;&#x53D1;REST API&#x7684;&#x89C6;&#x56FE;&#x4E2D;&#xFF0C;&#x867D;&#x7136;&#x6BCF;&#x4E2A;&#x89C6;&#x56FE;&#x5177;&#x4F53;&#x64CD;&#x4F5C;&#x7684;&#x6570;&#x636E;&#x4E0D;&#x540C;&#xFF0C;&#x4F46;&#x589E;&#x3001;&#x5220;&#x3001;&#x6539;&#x3001;&#x67E5;&#x7684;&#x5B9E;&#x73B0;&#x6D41;&#x7A0B;&#x57FA;&#x672C;&#x5957;&#x8DEF;&#x5316;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;&#x90E8;&#x5206;&#x4EE3;&#x7801;&#x4E5F;&#x662F;&#x53EF;&#x4EE5;&#x590D;&#x7528;&#x7B80;&#x5316;&#x7F16;&#x5199;&#x7684;&#xFF1A;<ul>
<li><strong>&#x589E;</strong>&#xFF1A;&#x6821;&#x9A8C;&#x8BF7;&#x6C42;&#x6570;&#x636E; -&gt; &#x6267;&#x884C;&#x53CD;&#x5E8F;&#x5217;&#x5316;&#x8FC7;&#x7A0B; -&gt; &#x4FDD;&#x5B58;&#x6570;&#x636E;&#x5E93; -&gt; &#x5C06;&#x4FDD;&#x5B58;&#x7684;&#x5BF9;&#x8C61;&#x5E8F;&#x5217;&#x5316;&#x5E76;&#x8FD4;&#x56DE;</li>
<li><strong>&#x5220;</strong>&#xFF1A;&#x5224;&#x65AD;&#x8981;&#x5220;&#x9664;&#x7684;&#x6570;&#x636E;&#x662F;&#x5426;&#x5B58;&#x5728; -&gt; &#x6267;&#x884C;&#x6570;&#x636E;&#x5E93;&#x5220;&#x9664;</li>
<li><strong>&#x6539;</strong>&#xFF1A;&#x5224;&#x65AD;&#x8981;&#x4FEE;&#x6539;&#x7684;&#x6570;&#x636E;&#x662F;&#x5426;&#x5B58;&#x5728; -&gt; &#x6821;&#x9A8C;&#x8BF7;&#x6C42;&#x7684;&#x6570;&#x636E; -&gt; &#x6267;&#x884C;&#x53CD;&#x5E8F;&#x5217;&#x5316;&#x8FC7;&#x7A0B; -&gt; &#x4FDD;&#x5B58;&#x6570;&#x636E;&#x5E93; -&gt; &#x5C06;&#x4FDD;&#x5B58;&#x7684;&#x5BF9;&#x8C61;&#x5E8F;&#x5217;&#x5316;&#x5E76;&#x8FD4;&#x56DE;</li>
<li><strong>&#x67E5;</strong>&#xFF1A;&#x67E5;&#x8BE2;&#x6570;&#x636E;&#x5E93; -&gt; &#x5C06;&#x6570;&#x636E;&#x5E8F;&#x5217;&#x5316;&#x5E76;&#x8FD4;&#x56DE;</li>
</ul>
</li>
</ol>
<p><strong>Django REST framework&#x53EF;&#x4EE5;&#x5E2E;&#x52A9;&#x6211;&#x4EEC;&#x7B80;&#x5316;&#x4E0A;&#x8FF0;&#x4E24;&#x90E8;&#x5206;&#x7684;&#x4EE3;&#x7801;&#x7F16;&#x5199;&#xFF0C;&#x5927;&#x5927;&#x63D0;&#x9AD8;REST API&#x7684;&#x5F00;&#x53D1;&#x901F;&#x5EA6;&#x3002;</strong></p>
<h2 id="&#x8BA4;&#x8BC6;django-rest-framework">&#x8BA4;&#x8BC6;Django REST framework</h2>
<p><img src="../images/drf_logo.png" alt="drf_logo"></p>
<p>Django REST framework &#x6846;&#x67B6;&#x662F;&#x4E00;&#x4E2A;&#x7528;&#x4E8E;&#x6784;&#x5EFA;Web API &#x7684;&#x5F3A;&#x5927;&#x800C;&#x53C8;&#x7075;&#x6D3B;&#x7684;&#x5DE5;&#x5177;&#x3002;</p>
<p>&#x901A;&#x5E38;&#x7B80;&#x79F0;&#x4E3A;DRF&#x6846;&#x67B6; &#x6216; REST framework&#x3002;</p>
<p>DRF&#x6846;&#x67B6;&#x662F;&#x5EFA;&#x7ACB;&#x5728;Django&#x6846;&#x67B6;&#x57FA;&#x7840;&#x4E4B;&#x4E0A;&#xFF0C;&#x7531;Tom Christie&#x5927;&#x725B;&#x4E8C;&#x6B21;&#x5F00;&#x53D1;&#x7684;&#x5F00;&#x6E90;&#x9879;&#x76EE;&#x3002;</p>
<h3 id="&#x7279;&#x70B9;">&#x7279;&#x70B9;</h3>
<ul>
<li>&#x63D0;&#x4F9B;&#x4E86;&#x5B9A;&#x4E49;&#x5E8F;&#x5217;&#x5316;&#x5668;Serializer&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x6839;&#x636E; Django ORM &#x6216;&#x8005;&#x5176;&#x5B83;&#x5E93;&#x81EA;&#x52A8;&#x5E8F;&#x5217;&#x5316;/&#x53CD;&#x5E8F;&#x5217;&#x5316;&#xFF1B;</li>
<li>&#x63D0;&#x4F9B;&#x4E86;&#x4E30;&#x5BCC;&#x7684;&#x7C7B;&#x89C6;&#x56FE;&#x3001;Mixin&#x6269;&#x5C55;&#x7C7B;&#xFF0C;&#x7B80;&#x5316;&#x89C6;&#x56FE;&#x7684;&#x7F16;&#x5199;&#xFF1B;</li>
<li>&#x4E30;&#x5BCC;&#x7684;&#x5B9A;&#x5236;&#x5C42;&#x7EA7;&#xFF1A;&#x51FD;&#x6570;&#x89C6;&#x56FE;&#x3001;&#x7C7B;&#x89C6;&#x56FE;&#x3001;&#x89C6;&#x56FE;&#x96C6;&#x5408;&#x5230;&#x81EA;&#x52A8;&#x751F;&#x6210; API&#xFF0C;&#x6EE1;&#x8DB3;&#x5404;&#x79CD;&#x9700;&#x8981;&#xFF1B;</li>
<li>&#x591A;&#x79CD;&#x8EAB;&#x4EFD;&#x8BA4;&#x8BC1;&#x548C;&#x6743;&#x9650;&#x8BA4;&#x8BC1;&#x65B9;&#x5F0F;&#x7684;&#x652F;&#x6301;&#xFF1B;</li>
<li>&#x5185;&#x7F6E;&#x4E86;&#x9650;&#x6D41;&#x7CFB;&#x7EDF;&#xFF1B;</li>
<li>&#x76F4;&#x89C2;&#x7684; API web &#x754C;&#x9762;&#xFF1B;</li>
<li>&#x53EF;&#x6269;&#x5C55;&#x6027;&#xFF0C;&#x63D2;&#x4EF6;&#x4E30;&#x5BCC;</li>
</ul>
<p>&#x8D44;&#x6599;&#xFF1A;</p>
<ul>
<li><a href="http://www.django-rest-framework.org/" target="_blank">&#x5B98;&#x65B9;&#x6587;&#x6863;</a></li>
<li><a href="https://github.com/encode/django-rest-framework/tree/master" target="_blank">Github&#x6E90;&#x7801;</a></li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../C01-IntroduceToDRF/CoreTaskToDevelopRESTAPI.html" class="navigation navigation-prev " aria-label="Previous page: 明确REST接口开发的核心任务"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../C02-DRFProject/index.html" class="navigation navigation-next " aria-label="Next page: DRF工程搭建"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
